package ui;

import javax.swing.JOptionPane;

/**
 * Classe que representa o frame principal do sistema
 *
 * @author Gutemberg Rodrigues
 */
public class FrameInitial extends javax.swing.JFrame {

    public FrameInitial() {
        initComponents();
    }

    @SuppressWarnings("unchecked")

    private void initComponents() {

        logo = new javax.swing.JLabel();
        nomeSistema = new javax.swing.JLabel();
        logoSistema = new javax.swing.JLabel();
        painelAtalhos = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        menu = new javax.swing.JMenuBar();
        menuArquivo = new javax.swing.JMenu();
        subMenuArquivoSobre = new javax.swing.JMenuItem();
        subMenuArquivoSair = new javax.swing.JMenuItem();
        menuExecutar = new javax.swing.JMenu();
        subMenuExecutarHist = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        logo.setFont(new java.awt.Font("Calibri", 3, 14));
        logo.setForeground(new java.awt.Color(153, 153, 153));
        logo.setText("Digital Image Processing");

        nomeSistema.setFont(new java.awt.Font("Calibri", 3, 12));
        nomeSistema.setText("System for Creating Histogram and Image Manipulation");

        logoSistema.setFont(new java.awt.Font("Highlight LET", 1, 48));
        logoSistema.setText("SCHIM");

        painelAtalhos.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Atalhos:", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 11), new java.awt.Color(153, 153, 153))); // NOI18N
        painelAtalhos.setForeground(new java.awt.Color(102, 102, 102));

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 10));
        jLabel1.setForeground(new java.awt.Color(102, 102, 102));
        jLabel1.setText("Histograma/Métodos");

        jLabel2.setFont(new java.awt.Font("Tahoma", 1, 10));
        jLabel2.setForeground(new java.awt.Color(102, 102, 102));
        jLabel2.setText("Sobre");

        jLabel3.setFont(new java.awt.Font("Tahoma", 1, 10));
        jLabel3.setForeground(new java.awt.Color(102, 102, 102));
        jLabel3.setText("Sair");

        jLabel4.setFont(new java.awt.Font("Tahoma", 0, 10));
        jLabel4.setForeground(new java.awt.Color(102, 102, 102));
        jLabel4.setText("Ctrl + Alt + H");

        jLabel5.setFont(new java.awt.Font("Tahoma", 0, 10));
        jLabel5.setForeground(new java.awt.Color(102, 102, 102));
        jLabel5.setText("Ctrl + Alt + S ");

        jLabel6.setFont(new java.awt.Font("Tahoma", 0, 10));
        jLabel6.setForeground(new java.awt.Color(102, 102, 102));
        jLabel6.setText("Ctrl + Alt + E");

        javax.swing.GroupLayout painelAtalhosLayout = new javax.swing.GroupLayout(painelAtalhos);
        painelAtalhos.setLayout(painelAtalhosLayout);
        painelAtalhosLayout.setHorizontalGroup(
            painelAtalhosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(painelAtalhosLayout.createSequentialGroup()
                .addGap(174, 174, 174)
                .addGroup(painelAtalhosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel2)
                    .addComponent(jLabel1)
                    .addComponent(jLabel3))
                .addGap(43, 43, 43)
                .addGroup(painelAtalhosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel6)
                    .addComponent(jLabel5)
                    .addComponent(jLabel4))
                .addContainerGap(179, Short.MAX_VALUE))
        );
        painelAtalhosLayout.setVerticalGroup(
            painelAtalhosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(painelAtalhosLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(painelAtalhosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(painelAtalhosLayout.createSequentialGroup()
                        .addComponent(jLabel4)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel5)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel6))
                    .addGroup(painelAtalhosLayout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel3)))
                .addContainerGap(39, Short.MAX_VALUE))
        );

        menuArquivo.setText("Arquivo");

        subMenuArquivoSobre.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.ALT_MASK | java.awt.event.InputEvent.CTRL_MASK));
        subMenuArquivoSobre.setText("Sobre");
        subMenuArquivoSobre.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                subMenuArquivoSobreActionPerformed(evt);
            }
        });
        menuArquivo.add(subMenuArquivoSobre);

        subMenuArquivoSair.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_E, java.awt.event.InputEvent.ALT_MASK | java.awt.event.InputEvent.CTRL_MASK));
        subMenuArquivoSair.setText("Sair");
        subMenuArquivoSair.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                subMenuArquivoSairActionPerformed(evt);
            }
        });
        menuArquivo.add(subMenuArquivoSair);

        menu.add(menuArquivo);

        menuExecutar.setText("Executar");

        subMenuExecutarHist.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_H, java.awt.event.InputEvent.ALT_MASK | java.awt.event.InputEvent.CTRL_MASK));
        subMenuExecutarHist.setText("Histogramas / Métodos");
        subMenuExecutarHist.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                subMenuExecutarHistActionPerformed(evt);
            }
        });
        menuExecutar.add(subMenuExecutarHist);

        menu.add(menuExecutar);

        setJMenuBar(menu);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap(447, Short.MAX_VALUE)
                .addComponent(logo)
                .addContainerGap())
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(211, Short.MAX_VALUE)
                .addComponent(logoSistema, javax.swing.GroupLayout.PREFERRED_SIZE, 197, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(189, 189, 189))
            .addGroup(layout.createSequentialGroup()
                .addGap(155, 155, 155)
                .addComponent(nomeSistema)
                .addContainerGap(166, Short.MAX_VALUE))
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(painelAtalhos, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(logo)
                .addGap(71, 71, 71)
                .addComponent(logoSistema, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(nomeSistema)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 56, Short.MAX_VALUE)
                .addComponent(painelAtalhos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        pack();
    }

    private void subMenuArquivoSairActionPerformed(java.awt.event.ActionEvent evt) {

        int resposta = JOptionPane.showConfirmDialog(this,
                        "Deseja realmente sair da aplicação?",
                        "Sair ",
                        JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);


                if(resposta == JOptionPane.YES_OPTION)
                {
                  System.exit(0);
                }
    }

    private void subMenuArquivoSobreActionPerformed(java.awt.event.ActionEvent evt) {
        ScreenInfo frameScreenInfo = new ScreenInfo();
        frameScreenInfo.openFrameScreenInfo();
    }

    private void subMenuExecutarHistActionPerformed(java.awt.event.ActionEvent evt) {
        FrameInput frameInput = new FrameInput();
    	frameInput.openFrameInput();
    }

    public static void main(String args[]) {
        FrameInitial frameInitial = new FrameInitial();
        frameInitial.setVisible(true);
        frameInitial.setLocationRelativeTo(null);
    }

    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel logo;
    private javax.swing.JLabel logoSistema;
    private javax.swing.JMenuBar menu;
    private javax.swing.JMenu menuArquivo;
    private javax.swing.JMenu menuExecutar;
    private javax.swing.JLabel nomeSistema;
    private javax.swing.JPanel painelAtalhos;
    private javax.swing.JMenuItem subMenuArquivoSair;
    private javax.swing.JMenuItem subMenuArquivoSobre;
    private javax.swing.JMenuItem subMenuExecutarHist;

}
